package process_demo.lock.reentrant_lock;

/**
 * @author haomin
 * @date 2022/05/05 20:59
 **/
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Main {
    public static void main(String[] args) {
        // 我们是主线程
        Lock lock = new ReentrantLock();    // 名字已经说明，这把锁是可重入锁

        lock.lock();        // 锁已经被 main 线程锁了

        lock.lock();
        System.out.println("说明允许可重入");
    }
}